# 列表推导式  [掌握]
# [表达式 for 变量 in 列表]

list1 = [i for i in range(1, 11)]
print(list1)

# 需求: 1-10 列表里面元素的立方
list2 = [i**3 for i in range(1, 11)]
print(list2)

list3 = ['hello world' for i in range(3)]
print(list3)

list4 = ['name' + str(i) for i in range(1, 6)]
print(list4)

list5 = [i for i in range(1, 101) if i % 2 != 0]
print(list5)

list6 = [i for i in range(1, 101) if i % 2 == 0]
print(list6)

list7 = [(i, j) for i in range(1, 3) for j in range(1, 3)]
print(list7)
